Get Lua Script
It gets another Lua script from an InteractTriggerX
, LuaComponent
or other component containing a Lua script.
#
ExampleThe following example gets the InteractWeapon
component from variable self.gameObj
and stores it in interactWeapon
variable.
local luaScript = self.componentWithLuaScript.script.self
#
User VariablesComponent | variable |
---|---|
InteractTriggerX | self.componentWithLuaScript |
#
FAQ#
What if I want to print a variable from another script?local luaScript = self.componentWithLuaScript.script.selfprint(luaScript.yourVariable)